<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>07媒体查询实现字体变化</title>
    <style>
        @media screen and (min-width:320px) {
            html {
                font-size: 14px;
            }
        }
        
        @media screen and (min-width:500px) {
            html {
                font-size: 50px;
            }
        }
        
        div {
            height: 1rem;
            font-size: .5rem;
            text-align: center;
            background-color: green;
            color: #fff;
            transition: all 1s;
            line-height: 1rem;
        }
    </style>
</head>

<body>
    <div>
        购物车
    </div>
</body>

</html>